package com.lvtongka.app.common.widget

import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.util.AttributeSet
import android.widget.EditText

/**
 * describe:
 *
 * @author:ZhangWei(张伟)
 * date:2024/11/10
 * time:16:46
 */
class UnderLineEditText(context: Context, attributeSet: AttributeSet) :
    androidx.appcompat.widget.AppCompatEditText(context, attributeSet) {
    private var paint: Paint = Paint()

    init {
        paint.style = Paint.Style.STROKE
        paint.color = Color.RED
    }

    override fun onDraw(canvas: Canvas) {
        super.onDraw(canvas)
        canvas?.drawLine(0f, this.height.toFloat() - 1, this.width - 1f, this.height.toFloat() - 1, paint)
    }
}